package com.zhou.controller;

import com.zhou.config.Result;
import com.zhou.entity.Captcha;
import com.zhou.service.CaptchaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhoujinchuan
 * @Description: （验证码控制层）
 * @CreateTime: 2024/1/17 16:29
 */
@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    @Autowired
    private CaptchaService captchaService;

    /**
     * 生成验证码拼图
     * @param captcha
     * @return
     */
    @PostMapping("get-captcha")
    public Result getCaptcha(@RequestBody Captcha captcha) {
        Captcha result = captchaService.getCaptcha(captcha);
        return Result.success(result);
    }

}

